//
//  SettingsScene.h
//  Frog Jump
//
//  Created by acumen on 7/26/13.
//
//

#ifndef __Frog_Jump__SettingsScene__
#define __Frog_Jump__SettingsScene__

#include <iostream>
#include "GeneralDef.h"
#include "GameController.h"
#include "MenuScene.h"

class SettingsScene : public cc::CCLayer {
    void refreshScene() {
        
    };
    
    void menuSound_Clicked(cc::CCObject *pSender) {
        if (pmUserDefault->getBoolForKey(SET_SOUND)) {
            pmUserDefault->setBoolForKey(SET_SOUND, false);
        } else {
            pmUserDefault->setBoolForKey(SET_SOUND, true);
        }
        printf("\nSET_SOUND: %s", pmUserDefault->getBoolForKey(SET_SOUND) ? "true" : "no");
    };
    
    
    void menuMusic_Clicked(cc::CCObject *pSender) {
        if (pmUserDefault->getBoolForKey(SET_MUSIC)) {
            pmUserDefault->setBoolForKey(SET_MUSIC, false);
        } else {
            pmUserDefault->setBoolForKey(SET_MUSIC, true);
        }
        printf("\nSET_MUSIC: %s", pmUserDefault->getBoolForKey(SET_MUSIC) ? "true" : "no");
    };
    
    void backToMenu(cc::CCObject *pSender) {
        GameController::popScene(MenuScene::scene());
    };
    
    cc::CCUserDefault *pmUserDefault;
public:
    virtual bool init();
    static cc::CCScene *scene();
    CREATE_FUNC(SettingsScene);
    ~SettingsScene();
};

#endif /* defined(__Frog_Jump__SettingsScene__) */
